import React, { Component } from "react";
import { Swiper } from "react-vant";
class Detail extends Component {
  render() {
    let { state } = this.props.location;
    console.log(state);
    return (
      <div>
        <div>
          <Swiper className="my-swipe" autoplay={3000}>
            <Swiper.Item>1</Swiper.Item>
            <Swiper.Item>2</Swiper.Item>
            <Swiper.Item>3</Swiper.Item>
            <Swiper.Item>4</Swiper.Item>
          </Swiper>
        </div>
        {state && (
          <div>
            <p>{state.title}</p>
            <img src={state.img} alt="" />
          </div>
        )}
      </div>
    );
  }
}

export default Detail;
